<?php

namespace app\Backend\controller;

use think\Controller;
use think\Request;
use app\common\model\User as UserModel;
use app\xt\Auth;

class Account extends Controller
{
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function index()
    {
        return view('');
    }

    public function save(Request $request)
    {
        $password = $request->post('password');
        $auth = Auth::getInstance();
        if (!UserModel::where('id', $auth->id())->update(['password' => md5($password)])) {
            $this->error('保存失败');
        }
        $this->success('保存成功！');
    }
}
